////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//		File Name		:		CButton.h
//
//		Author			:		JAYSON WU
//
//		Purpose			:		A header for all functions and members of the CButton class
//
//		Dates			:		Written( April 5, 2011 ) by JAYSON WU
//	
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef CBUTTON_H_
#define CBUTTON_H_
#include "CBaseObject.h"

enum EButtonType {BUTTON_NULL, BUTTON_HAND, BUTTON_ROCK, BUTTON_POISON, BUTTON_OIL, BUTTON_BALLISTA, BUTTON_ARCHER, BUTTON_CASTLEUPGRADE, BUTTON_MAX};

struct Color
{
public:
	int A, R, G, B;
};

class CButton : public CBaseObject
{
private:
	Color ButtonColor;
	RECT ButtonRect;
	int ButtonType;
	float ItemSize;
	int ItemID;
	float timer;
	int price;
	bool ShowPrice;

	float CoolDownMax;
	float CurrCoolDown;

	CButton( const CButton& copy );
	CButton& operator = (const CButton& assign);

public:
	CButton();
	~CButton();

	void Render();
	void Update(float fElapsedTime);


	RECT GetRect()				{ return ButtonRect;	}
	int GetButtonType()			{ return ButtonType;	}
	int GetPrice()				{ return price;			}
	bool GetShowPrice()			{ return ShowPrice;		}

	void SetPrice(int Price)	 { price = Price; }
	void SetButtonType(int Type) { ButtonType = Type;	}
	void SetItemSize(float Size) { ItemSize = Size;		}
	void SetItemID(int ID)		 { ItemID = ID;			}
	void SetUpRect(int Left, int Top, int Right, int Bottom);
	void SetButtonColor(int A, int R, int G, int B);

	//Collision
	bool CheckCollision( IBaseInterface* pBase );
};

#endif